FROM centos:7

RUN yum install -y openssh-server openssh-clients
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN mkdir /root/.ssh && ssh-keygen -t rsa -f /root/.ssh/id_rsa && cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys

RUN sed -ri 's/#\s*StrictHostKeyChecking ask/StrictHostKeyChecking no/g' /etc/ssh/ssh_config

CMD ["/usr/sbin/sshd", "-D"]

